home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 2 / Mac Magazin and MacEasy Magazine CD - Issue 02.iso / CD Extras / The Cruncher 1.1 Demo folder / Tutorial Folder / Help Wanted / Help Wanted.rsrc / TEXT_128.txt < prev    next >
Text File  |  1994-04-15  |  25KB  |  1,229 lines

  1. /* Help wanted.s - tutorial 12/16/93 FINAL */
  2.  
  3.  
  4. play(;i)
  5. {
  6.     gTESTING = 0;
  7.  
  8.     gInitialized = 0;
  9.     gSndChannel = 0;
  10.     gCurCheck = 1;
  11.     gDidTheMenu = 0;
  12.     gStep24ErrFlag = 0;
  13.     
  14.     MenusOnOff(0);    /* turn off menus */
  15.     MakeCheckBoxes();
  16.  
  17.     SetCurCell(1,1);
  18.  
  19.     StartBtn = NewAnimation(190, 218, 10, 2);
  20.     gAlreadyStarted = 0;
  21.     
  22.     Pointer = NewAnimation(ARecX(StartBtn)-41, ARecY(StartBtn)+6, 20, 2);
  23.     
  24.     gWaitFireClick = 0;
  25.     gFireCount = 0;
  26.     FireEngine = NewAnimation(0, -200, 174, 1);
  27.     FireBalloon = NewAnimation(0, -200, 190, 1);
  28.     FireLight1 = NewAnimation(0, -200, 182, 1);
  29.     FireLight2 = NewAnimation(0, -200, 182, 1);
  30.     FireSpeech = NewAnimation(0, -200, 2, 1);
  31.     FireClickMe = NewAnimation(0, -200, 210, 1);
  32.  
  33.     SetIdle(2, "OpeningIdle");
  34.     
  35. }
  36. /*-----------------------*/
  37. DoTest(;ani)
  38. {
  39.     gCurCheck = 20;
  40.     NBScrollForRange(102, 112);
  41. //    PointToNextStep();
  42. //    gStep24ErrFlag = 0;
  43.     SetIdle(2, "Step20");
  44.     
  45. }
  46. /*-----------------------*/
  47. OpeningIdle(;ani)
  48. {
  49. HoldMouseDowns(1);
  50.     CancelIdle("OpeningIdle");
  51.     gInitialized = 1;
  52. HoldMouseDowns(0);
  53.     ani = GetStickerAnim(2, 2);
  54.     SheBopDanceStart(ani, 2);
  55.     SheBopDance(ani, 2);
  56. }
  57. /*************** FIRE ERROR STUFF ********************/
  58. FireError(errCode; )
  59. {
  60.     /* 101 => wrong cell */
  61.     /* 102 => bad entry */
  62.     /* 103 => missing (=) */
  63.     /* 104 => bring ss front */
  64.     
  65.     gFireCount += 1;
  66.     if ((errCode != 101) || (gFireCount >= 2)) {
  67. HoldMouseDowns(1);
  68. DisableActions();
  69.         gFireCount = 0;
  70.         SetIdle(2, "FireIdle");
  71.         gFireCode = errCode;
  72.         gWaitFireClick = 1;
  73.     } else
  74.         DoBeep();
  75.  
  76. }
  77. /*-----------------------*/
  78. FireIdle(errCode; )
  79. {
  80.     CancelIdle("FireIdle");
  81.     FireEntrance(gFireCode);
  82.  
  83.     gWaitFireClick = 1;
  84. }
  85. /*-----------------------*/
  86. FireEntrance(errCode; right, width)
  87. {
  88. HoldMouseDowns(1);
  89.     right = GetSSRight();
  90.     gWidth = right - GetSSLeft();
  91.     
  92.     AMoveTo(FireEngine, right-(gWidth/2) + 40, GetSSBottom()-72);
  93.     Wait(FireEngine);
  94.     gSndChannel = PlayConsecutiveSound(92, gSndChannel);    /* Scram */    
  95.     AMove(FireEngine, -60, 0);
  96.     Wait(FireEngine);
  97.     gSndChannel = PlayConsecutiveSound(204, gSndChannel);    /* whistle */    
  98.     SetSprite(FireEngine, 172);
  99.     AMoveTo(FireBalloon, ARecX(FireEngine)-164, ARecY(FireEngine)-33);
  100.     Wait(FireBalloon);
  101.  
  102.     AMoveTo(FireLight1, ARecX(FireBalloon)+142, ARecY(FireBalloon)+65);
  103.     AMoveTo(FireLight2, ARecX(FireBalloon)+9, ARecY(FireBalloon)+65);
  104.  
  105.     SetSprite(FireSpeech, 190 + 2*(errCode-100));
  106.     AMoveTo(FireSpeech, ARecX(FireBalloon)+10, ARecY(FireBalloon)+14);
  107.     AMoveTo(FireClickMe, ARecX(FireBalloon)+35, ARecY(FireBalloon)+68);
  108.  
  109.     Wait(FireBalloon);
  110.     Wait(FireSpeech);
  111.     Wait(FireClickMe);
  112.     Wait(FireLight1);
  113.     Wait(FireLight2);
  114.     SetIdle(20, "DoFireLight");
  115. EnableActions();
  116. HoldMouseDowns(0);
  117. }
  118. /*-----------------------*/
  119. FireExit( ; x, y)
  120. {
  121. HoldMouseDowns(1);
  122.     CancelIdle("DoFireLight");    
  123.     x = ARecX(FireEngine);
  124.     y = ARecY(FireEngine);
  125.     if ((x > 0) && (y > 0)) {
  126.         AMoveTo(FireClickMe, 0, -200);
  127.         AMoveTo(FireSpeech, 0, -200);
  128.         AMoveTo(FireLight1, 0, -200);
  129.         AMoveTo(FireLight2, 0, -200);
  130.         Wait(FireLight1);
  131.         Wait(FireLight2);
  132.         AMoveTo(FireBalloon, 0, -200);
  133.     
  134.         gSndChannel = PlayConsecutiveSound(91, gSndChannel);    /* triangle */    
  135.         Wait(FireBalloon);
  136.     
  137.         SetSprite(FireEngine, 174);
  138.         Wait(FireEngine);
  139.         gSndChannel = PlayConsecutiveSound(92, gSndChannel);    /* Scram */    
  140.         AMove(FireEngine, -(gWidth/6), 0);
  141.         AMoveTo(FireEngine, 0, -200);
  142.     }
  143.     gWaitFireClick = 0;
  144.  
  145.     if (gStep24ErrFlag) {
  146.         Step24Error();
  147.     
  148.     } else
  149.         HoldMouseDowns(0);
  150. }
  151. /*-----------------------*/
  152. FireExitIdle()
  153. {
  154.     CancelIdle("FireExitIdle");    
  155.     FireExit();
  156.     if (gCurCheck > 1)
  157.         SetIdle(5, "Blinker");
  158. }
  159. /*-----------------------*/
  160. DoFireLight()
  161. {
  162.     SetSprite(FireEngine, 174);
  163.     APause(FireEngine, 10);
  164.     SetSprite(FireEngine, 172);
  165.     SetSprite(FireLight2, 184);
  166.     SetSprite(FireLight2, 186);
  167.     SetSprite(FireLight2, 188);
  168.     SetSprite(FireLight2, 182);
  169.     APause(FireLight2, 4);
  170.     Wait(FireLight2);
  171.     SetSprite(FireLight1, 184);
  172.     SetSprite(FireLight1, 186);
  173.     SetSprite(FireLight1, 188);
  174.     SetSprite(FireLight1, 182);
  175.     Wait(FireLight1);
  176.     SetSprite(FireEngine, 174);
  177.     APause(FireEngine, 10);
  178.     SetSprite(FireEngine, 172);
  179.     
  180.     ResetIdle("DoFireLight");
  181. }
  182. /**********************************************************/
  183.  
  184. /*-----------------------*/
  185. WaitASec(a, howMany)
  186. {
  187.     APause(a, howMany*60);
  188.     Wait(a);
  189.  
  190. }
  191. /*-----------------------*/
  192. animate_click(;a,ani,handled,mode)
  193. {
  194.     handled = 0;
  195.     a = CurrentSprite();
  196.     
  197.     if (gWaitFireClick) {
  198.         SetIdle(2, "FireExitIdle");
  199.         handled = 1;
  200.     } else if (gInitialized && (a == StartBtn) && (!gAlreadyStarted)) {
  201.         SetIdle(5, "DoStartBtn");
  202.         handled = 1;
  203.         gAlreadyStarted = 1;
  204.     } else if ((a == GetStickerAnim(2, 2)) ||
  205.         (a == GetStickerAnim(1, 2)) ||
  206.         (a == GetStickerAnim(0, 2)) ||
  207.         (a == GetStickerAnim(3, 2)) ||
  208.         (a == GetStickerAnim(7, 2))) {
  209.         mode = rand(3);
  210.         SheBopDanceStart(a, mode);
  211.         SheBopDance(a, mode);
  212.         handled = 1;
  213.     } else if ((a == GetStickerAnim(4, 2)) ||
  214.         (a == GetStickerAnim(6, 2)) ||
  215.         (a == GetStickerAnim(5, 2)) ||
  216.         (a == GetStickerAnim(8, 2))) {
  217.         mode = rand(9);
  218.         DooWopQuickLick1(a, 110+mode);
  219.         handled = 1;
  220.     }
  221.     return(handled);
  222. }
  223. /*-----------------------*/
  224. formulaBar_enter(; result)
  225. {
  226. /*    DebugCode(gCurCheck); */
  227.     if (gCurCheck==2) {                                    /* A1 */
  228.         result = CompareCellText(0, 0, "DATE");
  229.         if (result) {
  230.             FireError(result);
  231.         } else
  232.             Step2();
  233.     } else if (gCurCheck==3) {                            /* B1 */
  234.         result = CompareCellText(1, 0, "JOB");
  235.         if (result) {
  236.             FireError(result);
  237.         } else
  238.             Step3();
  239.     } else if (gCurCheck==4) {                            /* C1 */
  240.         result = CompareCellText(2, 0, "WAGE");
  241.         if (result) {
  242.             result = CompareCellText(2, 0, "WAGES");
  243.             if (result)
  244.                 FireError(result);
  245.         }
  246.         if (!result)
  247.             Step4();
  248.     } else if (gCurCheck==5) {                            /* D1 */
  249.         result = CompareCellText(3, 0, "HOURS");
  250.         if (result) {
  251.             FireError(result);
  252.         } else
  253.             Step5();
  254.     } else if (gCurCheck==6) {                            /* E1 */
  255.         result = CompareCellText(4, 0, "EARNED");
  256.         if (result) {
  257.             FireError(result);
  258.         } else
  259.             Step6();
  260.     } else if ((gCurCheck>=21) && (gCurCheck<=24)) {    /* E5 */
  261.         result = CompareCellText(4, 4, "=E2+E3+E4");
  262.         if (result) {
  263.             gStep24ErrFlag = 1;
  264.             FireError(102);
  265.         } else
  266.             Step24();
  267.     }
  268.  
  269.  
  270.     
  271.     return(1);
  272. }
  273.  
  274.  
  275. /*-----------------------*/
  276. verify_stickerDrag(;result)
  277. {
  278.     if (gCurCheck>25)
  279.         result = 1;
  280.     else
  281.         result = 0;
  282.     return(result);
  283. }
  284. /*-----------------------*/
  285. verify_resizeRowCol(;result)
  286. {
  287.     result = 0;
  288.     if (gCurCheck > 25)
  289.         result = 99;
  290.     else
  291.         result = 0;
  292.     return(result);
  293. }
  294. /*-----------------------*/
  295. menu_select(; menuID, menuItem, row, col, selMode, result)
  296. {
  297.     result = 1;
  298.     menuID = GetLastMenuID();
  299.     menuItem = GetLastMenuItem();
  300.     if ((menuID > 2) && (gCurCheck<25))
  301.         result = 0;
  302.  
  303.     row = GetCurCellRow();
  304.     col = GetCurCellCol();
  305.     selMode = GetCurSelMode();
  306.  
  307.     if (gCurCheck==8) {
  308.         if ((menuID == 10) && (menuItem == 2))
  309.             if (SSInFront()) {
  310.                 if ((col == 0) && (row == 0) && (selMode == 3)) {
  311.                     Step8();
  312.                     result = 1;
  313.                 } else
  314.                     result = 0;
  315.             } else
  316.                 result = -1;
  317.     } else if (gCurCheck==9) {
  318.         if ((menuID == 10) && (menuItem == 4))
  319.             if (SSInFront()) {
  320.                 if ((col == 0) && (row == 0) && (selMode == 3)) {
  321.                     Step9();
  322.                     result = 1;
  323.                 } else
  324.                     result = 0;
  325.             } else
  326.                 result = -1;
  327.     } else if (gCurCheck==11) {
  328.         if ((menuID == 5) && (menuItem == 10))
  329.             if (SSInFront()) {
  330.                 if ((col == 1) && (row == 0) && (selMode == 2)) {
  331.                     gDidTheMenu = 1;
  332.                     result = 1;
  333.                 } else
  334.                     result = 0;
  335.             } else
  336.                 result = -1;
  337.     } else if (gCurCheck==13) {
  338.         if ((menuID == 5) && (menuItem == 10))
  339.             if (SSInFront()) {
  340.                 if (TestSelRect(0,2,99,4)) {
  341.                     gDidTheMenu = 1;
  342.                     result = 1;
  343.                 } else
  344.                     result = 0;
  345.             } else
  346.                 result = -1;
  347.     } else if (gCurCheck==15) {
  348.         if ((menuID == 5) && (menuItem == 1))
  349.             if (SSInFront()) {
  350.                 if (TestSelRect(1,2,3,2)) {
  351.                     gDidTheMenu = 1;
  352.                     result = 1;
  353.                 } else
  354.                     result = 0;
  355.             } else
  356.                 result = -1;
  357.     } else if (gCurCheck==17) {
  358.         if ((menuID == 5) && (menuItem == 1))
  359.             if (SSInFront()) {
  360.                 if (TestSelRect(1,4,4,4)) {
  361.                     gDidTheMenu = 1;
  362.                     result = 1;
  363.                 } else
  364.                     result = 0;
  365.             } else
  366.                 result = -1;
  367.     } else if (gCurCheck==19) {
  368.         if ((menuID == 5) && (menuItem == 1))
  369.             if (SSInFront()) {
  370.                 if (TestSelRect(1,0,3,0)) {
  371.                     gDidTheMenu = 1;
  372.                     result = 1;
  373.                 } else
  374.                     result = 0;
  375.             } else
  376.                 result = -1;
  377.     }
  378.  
  379.  
  380.     if (result == 0)
  381.         FireError(101);
  382.     else if (result == -1) {
  383.         FireError(104);
  384.         result = 0;
  385.     }
  386.     
  387.     return(result);
  388. }
  389. /*-----------------------*/
  390. verify_fSelect(;row, col, result)
  391. {
  392.     result = 1;
  393.     row = GetCurCellRow();
  394.     col = GetCurCellCol();
  395.     if (gWaitFireClick) {
  396.         result = 0;
  397.     } else if (gCurCheck==22) {
  398.         if ((col == 4) && (row == 4))
  399.             if ((result = TestFSelRect(1,4,1,4))) {
  400.                 Step22();
  401.             }
  402.     } else if (gCurCheck==23) {
  403.         if ((col == 4) && (row == 4))
  404.             if ((result = TestFSelRect(2,4,2,4))) {
  405.                 Step23();
  406.             }
  407.     } else if (gCurCheck==24) {
  408.         if ((col == 4) && (row == 4))
  409.             if ((result = TestFSelRect(3,4,3,4))) {
  410.                 /* do nothing */
  411.             }
  412.     }
  413.     if (!result) {
  414.         DoBeep();
  415.         result = TestFSelRect(-2,-2,-2,-2);
  416.     }
  417.     return(1);
  418. }
  419. /*-----------------------*/
  420. formulaBar_type(; row, col, result)
  421. {
  422.     result = 0;
  423.     row = GetCurCellRow();
  424.     col = GetCurCellCol();
  425.     
  426.     if (gCurCheck>25) {
  427.         result = 1;
  428.     } else if (gWaitFireClick) {
  429.         DoBeep();
  430. //        SetIdle(2, "FireExitIdle");
  431.     } else if (gCurCheck==2) {
  432.         if ((col == 0) && (row == 0)) {
  433.             result = 1;
  434.         } else
  435.             result = 0;
  436.     } else if (gCurCheck==3) {
  437.         if ((col == 1) && (row == 0)) {
  438.             result = 1;
  439.         } else
  440.             result = 0;
  441.     } else if (gCurCheck==4) {
  442.         if ((col == 2) && (row == 0)) {
  443.             result = 1;
  444.         } else
  445.             result = 0;
  446.     } else if (gCurCheck==5) {
  447.         if ((col == 3) && (row == 0)) {
  448.             result = 1;
  449.         } else
  450.             result = 0;
  451.     } else if (gCurCheck==6) {
  452.         if ((col == 4) && (row == 0)) {
  453.             result = 1;
  454.         } else
  455.             result = 0;
  456.     } else if ((gCurCheck>=21) && (gCurCheck<=24)) {
  457.         if ((col == 4) && (row == 4)) {
  458.             result = 1;
  459.             if (gCurCheck == 21)
  460.                 Step21();
  461.         } else
  462.             result = 0;
  463.     }
  464.  
  465.     if ((result == 0) && !gWaitFireClick)
  466.         FireError(101);
  467.  
  468.     SetFTypingVerified(result);
  469.     
  470.     return(1);
  471. }
  472.  
  473. /*-----------------------*/
  474. DoStartBtn(;a)
  475. {
  476. HoldMouseDowns(1);
  477.     CancelIdle("DoStartBtn");
  478.  
  479.     gSndChannel = PlayConsecutiveSound(90, gSndChannel);    /* saxScram */    
  480.     NBArrangeWindow(270, 17);
  481.  
  482.     if (gTESTING)
  483.         DoTest();
  484.  
  485.     a = GetCheckBox(gCurCheck);
  486.     AMoveTo(Pointer, ARecX(a)-41, ARecY(a)-4);
  487.     Wait(Pointer);
  488.  
  489.     UnderlineCheckText(gCurCheck);
  490.     gBlinkState = 1;
  491.     
  492.     if (gTESTING==0)
  493.         SetIdle(5, "Step1");
  494.  
  495.     SetIdle(30, "Blinker");
  496. // HoldMouseDowns(0);
  497. }
  498. /*-----------------------*/
  499. CheckCurBox(halfSecs, whichBox;a, ticks)
  500. {
  501.     a = GetCheckBox(whichBox);
  502.     gSndChannel = PlayConsecutiveSound(100, gSndChannel);    /* check */    
  503.     SetSprite(a, 152);
  504.     ticks = 30 * halfSecs;
  505.     if (ticks > 0)
  506.         APause(a, ticks);
  507.     SetSprite(a, 152);
  508.     Wait(a);
  509. }
  510. /*-----------------------*/
  511. DoCheckBox(halfSecs, whichBox ;a)
  512. {
  513.     SetSprite(Pointer, 22);
  514.     APause(Pointer, 10);
  515.     Wait(Pointer);
  516.     SetSprite(Pointer, 20);
  517.     CheckCurBox(halfSecs, whichBox);
  518. }
  519. /*-----------------------*/
  520. PointToNextStep(;a)
  521. {
  522.     a = GetCheckBox(gCurCheck);
  523.     SetSprite(Pointer, 22);
  524.     AMoveTo(Pointer, ARecX(a)-41, ARecY(a)-4);
  525.     APause(Pointer, 40);
  526.     Wait(Pointer);
  527.     SetSprite(Pointer, 20);
  528.     Wait(Pointer);
  529.     UnderlineCheckText(gCurCheck);
  530.     gBlinkState = 1;
  531.     
  532.     SetIdle(5, "Blinker");
  533. }
  534. /*-----------------------*/
  535. Blinker()
  536. {
  537. //HoldMouseDowns(1);
  538.     if (!gWaitFireClick) {
  539.         UnderlineCheckText(gCurCheck);
  540.         if (gBlinkState == 1) {
  541.             gBlinkState = 0;
  542.             SetIdle(3, "Blinker");
  543.         } else {
  544.             gBlinkState = 1;
  545.             SetIdle(40, "Blinker");
  546.         }
  547.     }
  548. //HoldMouseDowns(0);
  549. }
  550. /*-----------------------*/
  551. KillBlinker(whichCheck)
  552. {
  553.     CancelIdle("Blinker");    
  554.     if (gBlinkState == 1) {
  555.         UnderlineCheckText(whichCheck);
  556.         gBlinkState = 0;
  557.     }
  558. }
  559. /*-----------------------*/
  560. SheBopIntro(phrase)
  561. {
  562.     if ((phrase <= 0) || (phrase == 2)) {
  563.         gSndChannel = PlayConsecutiveSound(201, gSndChannel);    /* triangle */    
  564.     } else if (phrase == 1) {
  565.         gSndChannel = PlayConsecutiveSound(90, gSndChannel);    /* saxScram */    
  566.         gSndChannel = PlayConsecutiveSound(91, gSndChannel);    /* triangle2 */    
  567.     }
  568. }
  569. /*-----------------------*/
  570. SheBopMusic(phrase)
  571. {
  572.     if (phrase <= 0) {
  573.         gSndChannel = PlayConsecutiveSound(205, gSndChannel);    /* congas 1 */    
  574.         gSndChannel = PlayConsecutiveSound(206, gSndChannel);    /* congas 2 */    
  575.     } else if (phrase == 1) {
  576.         gSndChannel = PlayConsecutiveSound(206, gSndChannel);    /* congas 2 */    
  577.         gSndChannel = PlayConsecutiveSound(207, gSndChannel);    /* congas 3 */    
  578.     } else if (phrase >= 2) {
  579.         gSndChannel = PlayConsecutiveSound(205, gSndChannel);    /* congas 1 */    
  580.         gSndChannel = PlayConsecutiveSound(206, gSndChannel);    /* congas 2 */    
  581.         gSndChannel = PlayConsecutiveSound(207, gSndChannel);    /* congas 3 */    
  582.     }
  583. }
  584. /*-----------------------*/
  585. SheBopOutro(phrase)
  586. {
  587.     if ((phrase <= 0) || (phrase == 2)) {
  588.         gSndChannel = PlayConsecutiveSound(204, gSndChannel);    /* whistle */    
  589.     } else if ((phrase == 1) || (phrase == 3)) {
  590.         gSndChannel = PlayConsecutiveSound(200, gSndChannel);    /* shaker */    
  591.     }
  592. }
  593. /*-----------------------*/
  594. SheBopDanceStart(ani, mode;)
  595. {
  596.     Wait(ani);
  597.     SheBopIntro(mode);
  598.     
  599.     SetSprite(ani, 104);
  600.     SetSprite(ani, 108);
  601.     APause(ani, 10);
  602.     Wait(ani);
  603.     SetSprite(ani, 104);
  604.     SetSprite(ani, 102);
  605.     Wait(ani);
  606.     SetSprite(ani, 102);
  607.     while(SoundsToPlay(gSndChannel)) {} ;    
  608. }
  609. /*-----------------------*/
  610. SheBopDance(ani, mode;)
  611. {
  612.     SetSprite(ani, 104);
  613.     Wait(ani);
  614.     SheBopMusic(mode);
  615.     SetSprite(ani, 104);
  616.     SetSprite(ani, 106);
  617.     SetSprite(ani, 104);
  618.     SetSprite(ani, 106);
  619.     while(SoundsToPlay(gSndChannel))
  620.     {    
  621.         SetSprite(ani, 108);
  622.         SetSprite(ani, 110);
  623.         Wait(ani);
  624.         SetSprite(ani, 110);
  625.     }
  626.     SheBopOutro(mode);
  627.     SetSprite(ani, 106);
  628.     SetSprite(ani, 104);
  629.     SetSprite(ani, 102);
  630. }
  631. /*-----------------------*/
  632. SheBopPuzzled(ani;saveDelay)
  633. {
  634.     saveDelay = GetADelay();
  635.     SetADelay(8);
  636.     
  637.     Wait(ani);
  638.     gSndChannel = PlayConsecutiveSound(90, gSndChannel);    /* saxScram */    
  639.     gSndChannel = PlayConsecutiveSound(91, gSndChannel);    /* triangle2 */    
  640.     
  641.     SetSprite(ani, 104);
  642.     SetSprite(ani, 108);
  643.     SetSprite(ani, 104);
  644.     SetSprite(ani, 102);
  645.     Wait(ani);
  646.     while(SoundsToPlay(gSndChannel)) {} ;    
  647.  
  648.     gSndChannel = PlayConsecutiveSound(204, gSndChannel);    /* whistle */    
  649.     SetSprite(ani, 114);
  650.  
  651.     APause(ani, 120);
  652.     SetSprite(ani, 114);
  653.     SetADelay(saveDelay);
  654. }
  655. /*-----------------------*/
  656. DooWopDispatch(num, riff)
  657. {
  658.     ani = GetStickerAnim(num, 2);
  659.     if (riff==1)
  660.         DooWopQuickLick1(ani, 114);
  661.     else if (riff==2)
  662.         DooWopQuickLick1(ani, 113);
  663.     else if (riff==3)
  664.         DooWopQuickLick3(ani);
  665.     else 
  666.         DooWopQuickLick2(ani);
  667.     
  668. }
  669. /*-----------------------*/
  670. DooWopQuickLick1(ani, num ; saveDelay)
  671. {
  672.     saveDelay = GetADelay();
  673.     SetADelay(16);
  674.  
  675.     SetSprite(ani, 130);
  676.     Wait(ani);
  677.     gSndChannel = PlayConsecutiveSound(num, gSndChannel);    /* squeek up */    
  678.     SetSprite(ani, 126);
  679.     SetSprite(ani, 124);
  680.     Wait(ani);
  681.     while(SoundsToPlay(gSndChannel)) {} ;    
  682.  
  683.     SetSprite(ani, 122);
  684.     Wait(ani);
  685.     
  686.     SetADelay(saveDelay);
  687. }
  688. /*-----------------------*/
  689. DooWopQuickLick2(ani; saveDelay)
  690. {
  691.     saveDelay = GetADelay();
  692.     SetADelay(15);
  693.  
  694.     SetSprite(ani, 124);
  695.     Wait(ani);
  696.     gSndChannel = PlayConsecutiveSound(112, gSndChannel);    /* riff 3 */    
  697.     SetSprite(ani, 126);
  698.     SetSprite(ani, 124);
  699.     SetSprite(ani, 126);
  700.     SetSprite(ani, 124);
  701.     Wait(ani);
  702.     while(SoundsToPlay(gSndChannel)) {} ;    
  703.  
  704.     SetSprite(ani, 126);
  705.     Wait(ani);
  706.     gSndChannel = PlayConsecutiveSound(117, gSndChannel);    /* zot! */    
  707.     while(SoundsToPlay(gSndChannel)) {} ;    
  708.  
  709.     SetSprite(ani, 122);
  710.     Wait(ani);
  711.     
  712.     SetADelay(saveDelay);
  713. }
  714. /*-----------------------*/
  715. DooWopQuickLick3(ani; saveDelay)
  716. {
  717.     saveDelay = GetADelay();
  718.     SetADelay(16);
  719.  
  720.     SetSprite(ani, 124);
  721.     Wait(ani);
  722.     gSndChannel = PlayConsecutiveSound(110, gSndChannel);    /* riff 1a */    
  723.     SetSprite(ani, 124);
  724.     SetSprite(ani, 128);
  725.     SetSprite(ani, 124);
  726.     Wait(ani);
  727.     while(SoundsToPlay(gSndChannel)) {} ;    
  728.  
  729.     SetSprite(ani, 124);
  730.     Wait(ani);
  731.     gSndChannel = PlayConsecutiveSound(111, gSndChannel);    /* riff 1b */    
  732.     SetSprite(ani, 126);
  733.     APause(ani,20);
  734.     SetSprite(ani, 124);
  735.     Wait(ani);
  736.     while(SoundsToPlay(gSndChannel)) {} ;    
  737.  
  738.     SetSprite(ani, 122);
  739.     Wait(ani);
  740.     
  741.     SetADelay(saveDelay);
  742. }
  743. /*-----------------------*/
  744. SheBopFinale(; ani)
  745. {
  746.     ani = GetStickerAnim(7, 2);
  747. //    SheBopDanceStart(ani, 2);
  748.     
  749.     gCurCheck = 25;
  750.     UnderlineCheckText(gCurCheck);
  751.     CheckCurBox(3, gCurCheck);
  752.     UnderlineCheckText(gCurCheck);
  753.  
  754.     gCurCheck = gCurCheck + 1;
  755.     UnderlineCheckText(gCurCheck);
  756.     CheckCurBox(3, gCurCheck);
  757.     UnderlineCheckText(gCurCheck);
  758.  
  759.     gCurCheck = gCurCheck + 1;
  760.     UnderlineCheckText(gCurCheck);
  761.     CheckCurBox(3, gCurCheck);
  762.     UnderlineCheckText(gCurCheck);
  763.  
  764.     SheBopDance(ani, 3);
  765. }
  766. /*-----------------------*/
  767. CheckIt()
  768. {
  769.     gCurCheck = gCurCheck + 1;
  770.     KillBlinker(gCurCheck-1);
  771.     DoCheckBox(0, gCurCheck-1);
  772. }
  773.  
  774. /*-----------------------*/
  775. Step1(;row,col)
  776. {
  777. HoldMouseDowns(1);
  778.     row = GetCurCellRow();
  779.     col = GetCurCellCol();
  780.     if ((col == 0) && (row == 0)) {        /* A1 */
  781.         CancelIdle("Step1");    
  782.         CheckIt();
  783.         NBScrollForRange(16, 33);
  784.         PointToNextStep();
  785.         /* formulaBar_type & formulaBar_enter handle next step */
  786.         
  787.     } else
  788.         ResetIdle("Step1");
  789. HoldMouseDowns(0);
  790. }
  791. /*-----------------------*/
  792. Step2()
  793. {
  794. HoldMouseDowns(1);
  795.     CheckIt();
  796.     NBScrollForRange(26, 33);
  797.     PointToNextStep();
  798.     /* formulaBar_type & formulaBar_enter handle next step */
  799.  
  800. HoldMouseDowns(0);
  801. }
  802. /*-----------------------*/
  803. Step3()
  804. {
  805. HoldMouseDowns(1);
  806.     CheckIt();
  807.     NBScrollForRange(26, 33);
  808.     PointToNextStep();
  809.     /* formulaBar_type & formulaBar_enter handle next step */
  810.  
  811. HoldMouseDowns(0);
  812. }
  813. /*-----------------------*/
  814. Step4()
  815. {
  816. HoldMouseDowns(1);
  817.     CheckIt();
  818.     NBScrollForRange(26, 33);
  819.     PointToNextStep();
  820.     /* formulaBar_type & formulaBar_enter handle next step */
  821.  
  822. HoldMouseDowns(0);
  823. }
  824. /*-----------------------*/
  825. Step5()
  826. {
  827. HoldMouseDowns(1);
  828.     CheckIt();
  829.     NBScrollForRange(27, 33);
  830.     PointToNextStep();
  831.     /* formulaBar_type & formulaBar_enter handle next step */
  832.  
  833. HoldMouseDowns(0);
  834. }
  835. /*-----------------------*/
  836. Step6(;ani)
  837. {
  838. HoldMouseDowns(1);
  839. DisableActions();
  840.     CheckIt();
  841.     NBScrollForRange(38, 48);
  842.     PointToNextStep();
  843.     
  844.     ani = GetStickerAnim(1, 2);
  845.     SheBopDance(ani, 1);
  846.     
  847.     SetIdle(2, "Step7");
  848. //HoldMouseDowns(0);
  849. EnableActions();
  850. }
  851. /*-----------------------*/
  852. Step7(;row,col,selMode)
  853. {
  854. HoldMouseDowns(1);
  855.     row = GetCurCellRow();
  856.     col = GetCurCellCol();
  857.     selMode = GetCurSelMode();
  858.     if ((col == 0) && (row == 0) && (selMode == 3)) {
  859.         CancelIdle("Step7");    
  860.         CheckIt();
  861.         NBScrollForRange(38, 48);
  862.         PointToNextStep();
  863.         TurnOnMenu(10,2);    /*Format->Font Style->Bold */
  864.         /* menu_select handles next step */
  865.         
  866.     } else
  867.         ResetIdle("Step7");
  868. HoldMouseDowns(0);
  869. }
  870. /*-----------------------*/
  871. Step8()
  872. {
  873. HoldMouseDowns(1);
  874.     CheckIt();
  875.     NBScrollForRange(38, 48);
  876.     PointToNextStep();
  877.  
  878.     MenusOnOff(0);    /* turn off menus */
  879.     TurnOnMenu(10,4);    /*Format->Font Style->Underline */
  880.     /* menu_select handles next step */
  881.  
  882. HoldMouseDowns(0);
  883. }
  884. /*-----------------------*/
  885. Step9()
  886. {
  887. HoldMouseDowns(1);
  888. DisableActions();
  889. //    CheckIt();
  890.     KillBlinker(gCurCheck);
  891.     DoCheckBox(0, gCurCheck);
  892.     MenusOnOff(0);    /* turn off menus */
  893.     NBScrollForRange(49, 63);
  894.  
  895.     DooWopDispatch(5, 114);
  896.     
  897.     gCurCheck = gCurCheck + 1;
  898.     PointToNextStep();
  899.  
  900.     SetIdle(2, "Step10");
  901. // HoldMouseDowns(0);
  902. EnableActions();
  903. }
  904. /*-----------------------*/
  905. Step10(;row,col,selMode)
  906. {
  907. HoldMouseDowns(1);
  908.     row = GetCurCellRow();
  909.     col = GetCurCellCol();
  910.     selMode = GetCurSelMode();
  911.     if ((col == 1) && (row == 0) && (selMode == 2)) {
  912.         CancelIdle("Step10");    
  913.         CheckIt();
  914.         NBScrollForRange(49, 63);
  915.         PointToNextStep();
  916.         TurnOnMenu(5,10);    /*Format->Column Width */
  917.  
  918.         gDidTheMenu = 0;
  919.         SetIdle(2, "Step11");
  920.         
  921.     } else {
  922.         ResetIdle("Step10");
  923.         HoldMouseDowns(0);
  924.     }
  925. }
  926. /*-----------------------*/
  927. Step11(;width)
  928. {
  929. HoldMouseDowns(1);
  930.     width = GetColWidth(1);
  931.     if (width == 110) {
  932.         CancelIdle("Step11");    
  933.         CheckIt();
  934.         MenusOnOff(0);    /* turn off menus */
  935.         NBScrollForRange(57, 64);
  936.         PointToNextStep();
  937.         
  938.         SetIdle(2, "Step12");
  939.     } else {
  940.         if (gDidTheMenu) {
  941.             FireError(102);
  942.             gDidTheMenu = 0;
  943.         }
  944.         ResetIdle("Step11");
  945.         HoldMouseDowns(0);
  946.     }
  947. }
  948. /*-----------------------*/
  949. Step12()
  950. {
  951. HoldMouseDowns(1);
  952.     if (TestSelRect(0,2,99,4)) {
  953.         CancelIdle("Step12");    
  954.         CheckIt();
  955.         NBScrollForRange(57, 64);
  956.         PointToNextStep();
  957.         TurnOnMenu(5,10);    /*Format->Column Width */
  958.  
  959.         gDidTheMenu = 0;
  960.         SetIdle(2, "Step13");
  961.     } else {
  962.         ResetIdle("Step12");
  963.         HoldMouseDowns(0);
  964.     }
  965. }
  966. /*-----------------------*/
  967. Step13(;width,ani)
  968. {
  969. HoldMouseDowns(1);
  970.     width = GetColWidth(3);
  971.     if (width == 55) {
  972.         DisableActions();
  973.         CancelIdle("Step13");    
  974. //        CheckIt();
  975.         KillBlinker(gCurCheck);
  976.         DoCheckBox(0, gCurCheck);
  977.         MenusOnOff(0);    /* turn off menus */
  978.         NBScrollForRange(66, 82);
  979.  
  980.         ani = GetStickerAnim(0, 2);
  981.         SheBopDance(ani, 1);
  982.     
  983.         gCurCheck = gCurCheck + 1;
  984.         PointToNextStep();
  985.  
  986.         SetIdle(2, "Step14");
  987.         EnableActions();
  988.     } else {
  989.         if (gDidTheMenu) {
  990.             FireError(102);
  991.             gDidTheMenu = 0;
  992.         }
  993.         ResetIdle("Step13");
  994.         HoldMouseDowns(0);
  995.     }
  996. }
  997. /*-----------------------*/
  998. Step14()
  999. {
  1000. HoldMouseDowns(1);
  1001.     if (TestSelRect(1,2,3,2)) {
  1002.         CancelIdle("Step14");    
  1003.         CheckIt();
  1004.         NBScrollForRange(66, 82);
  1005.         PointToNextStep();
  1006.         TurnOnMenu(5,1);    /*Format->Cell Attributes */
  1007.  
  1008.         gDidTheMenu = 0;
  1009.         SetIdle(2, "Step15");
  1010.     } else {
  1011.         ResetIdle("Step14");
  1012.         HoldMouseDowns(0);
  1013.     }
  1014. }
  1015. /*-----------------------*/
  1016. Step15(;numForm, decPlaces, format)
  1017. {
  1018. HoldMouseDowns(1);
  1019.     numForm = GetCellNumForm(2,1);
  1020.     decPlaces = numForm % 16;
  1021.     format = numForm / 16; 
  1022.     if ((format == 3) && (decPlaces == 2)) {
  1023.         CancelIdle("Step15");    
  1024.         CheckIt();
  1025.         MenusOnOff(0);    /* turn off menus */
  1026.         NBScrollForRange(75, 82);
  1027.         PointToNextStep();
  1028.         
  1029.         SetIdle(2, "Step16");
  1030.     } else {
  1031.         if (gDidTheMenu) {
  1032.             FireError(102);
  1033.             gDidTheMenu = 0;
  1034.         }
  1035.         ResetIdle("Step15");
  1036.         HoldMouseDowns(0);
  1037.     }
  1038. }
  1039. /*-----------------------*/
  1040. Step16()
  1041. {
  1042. HoldMouseDowns(1);
  1043.     if (TestSelRect(1,4,4,4)) {
  1044.         CancelIdle("Step16");    
  1045.         CheckIt();
  1046.         NBScrollForRange(75, 82);
  1047.         PointToNextStep();
  1048.         TurnOnMenu(5,1);    /*Format->Cell Attributes */
  1049.  
  1050.         gDidTheMenu = 0;
  1051.         SetIdle(2, "Step17");
  1052.         
  1053.     } else {
  1054.         ResetIdle("Step16");
  1055.         HoldMouseDowns(0);
  1056.     }
  1057. }
  1058. /*-----------------------*/
  1059. Step17(;numForm, decPlaces, format, ani)
  1060. {
  1061. HoldMouseDowns(1);
  1062.     numForm = GetCellNumForm(4,1);
  1063.     decPlaces = numForm % 16;
  1064.     format = numForm / 16; 
  1065.     if ((format == 3) && (decPlaces == 2)) {
  1066.         DisableActions();
  1067.         CancelIdle("Step17");    
  1068. //        CheckIt();
  1069.         KillBlinker(gCurCheck);
  1070.         DoCheckBox(0, gCurCheck);
  1071.         MenusOnOff(0);    /* turn off menus */
  1072.         NBScrollForRange(86, 98);
  1073.  
  1074.         ani = GetStickerAnim(3, 2);
  1075.         SheBopDance(ani, 1);
  1076.     
  1077.         gCurCheck = gCurCheck + 1;
  1078.         PointToNextStep();
  1079.         
  1080.         SetIdle(2, "Step18");
  1081.         EnableActions();
  1082.     } else {
  1083.         if (gDidTheMenu) {
  1084.             FireError(102);
  1085.             gDidTheMenu = 0;
  1086.         }
  1087.         ResetIdle("Step17");
  1088.         HoldMouseDowns(0);
  1089.     }
  1090. }
  1091. /*-----------------------*/
  1092. Step18()
  1093. {
  1094. HoldMouseDowns(1);
  1095.     if (TestSelRect(1,0,3,0)) {
  1096.         CancelIdle("Step18");    
  1097.         CheckIt();
  1098.         NBScrollForRange(86, 98);
  1099.         PointToNextStep();
  1100.         TurnOnMenu(5,1);    /*Format->Cell Attributes */
  1101.  
  1102.         gDidTheMenu = 0;
  1103.         SetIdle(2, "Step19");
  1104.         
  1105.     } else {
  1106.         ResetIdle("Step18");
  1107.         HoldMouseDowns(0);
  1108.     }
  1109. }
  1110. /*-----------------------*/
  1111. Step19(;numForm, format)
  1112. {
  1113. HoldMouseDowns(1);
  1114.     numForm = GetCellNumForm(0,1);
  1115.     format = numForm / 16; 
  1116.     if ((format >= 8) && (format <= 13)) {
  1117.         DisableActions();
  1118.         CancelIdle("Step19");    
  1119. //        CheckIt();
  1120.         KillBlinker(gCurCheck);
  1121.         DoCheckBox(0, gCurCheck);
  1122.         MenusOnOff(0);    /* turn off menus */
  1123.         NBScrollForRange(99, 112);
  1124.  
  1125.         DooWopDispatch(6, 113);
  1126.         
  1127.         gCurCheck = gCurCheck + 1;
  1128.         PointToNextStep();
  1129.         
  1130.         SetIdle(2, "Step20");
  1131.         EnableActions();
  1132.     } else {
  1133.         if (gDidTheMenu) {
  1134.             FireError(102);
  1135.             gDidTheMenu = 0;
  1136.         }
  1137.         ResetIdle("Step19");
  1138.         HoldMouseDowns(0);
  1139.     }
  1140. }
  1141. /*-----------------------*/
  1142. Step20(;row,col)
  1143. {
  1144. HoldMouseDowns(1);
  1145.     row = GetCurCellRow();
  1146.     col = GetCurCellCol();
  1147.     if ((col == 4) && (row == 4)) {
  1148.         CancelIdle("Step20");    
  1149.         CheckIt();
  1150.         NBScrollForRange(102, 112);
  1151.         PointToNextStep();
  1152.         
  1153.     } else
  1154.         ResetIdle("Step20");
  1155. HoldMouseDowns(0);
  1156. }
  1157. /*-----------------------*/
  1158. Step21()
  1159. {
  1160. HoldMouseDowns(1);
  1161.     CheckIt();
  1162.     NBScrollForRange(103, 112);
  1163.     PointToNextStep();
  1164. HoldMouseDowns(0);
  1165. }
  1166. /*-----------------------*/
  1167. Step22()
  1168. {
  1169. HoldMouseDowns(1);
  1170.     CheckIt();
  1171.     NBScrollForRange(104, 112);
  1172.     PointToNextStep();
  1173. HoldMouseDowns(0);
  1174. }
  1175. /*-----------------------*/
  1176. Step23()
  1177. {
  1178. HoldMouseDowns(1);
  1179.     CheckIt();
  1180.     NBScrollForRange(105, 112);
  1181.     PointToNextStep();
  1182. HoldMouseDowns(0);
  1183. }
  1184. /*-----------------------*/
  1185. Step24Error(;a, i)
  1186. {
  1187. // HoldMouseDowns(1);
  1188.     gSndChannel = PlayConsecutiveSound(92, gSndChannel);    /* Scram */    
  1189.  
  1190.     KillBlinker(gCurCheck);
  1191.     for (i=gCurCheck-1;i>=20;i--) {
  1192.         a = GetCheckBox(i);
  1193.         SetSprite(a, 150);
  1194.         Wait(a);
  1195.     }        
  1196.     gCurCheck = 20;
  1197.     NBScrollForRange(102, 112);
  1198.     PointToNextStep();
  1199.     gStep24ErrFlag = 0;
  1200.     SetIdle(2, "Step20");
  1201. // HoldMouseDowns(0);
  1202. }
  1203. /*-----------------------*/
  1204. Step24()
  1205. {
  1206. HoldMouseDowns(1);
  1207. DisableActions();
  1208.     KillBlinker(gCurCheck);
  1209.     AMoveTo(Pointer,0, -100);
  1210.     DoCheckBox(0, gCurCheck);
  1211.     gCurCheck = gCurCheck + 1;
  1212.     while (gCurCheck < 25) {
  1213.         DoCheckBox(0, gCurCheck);
  1214.         gCurCheck = gCurCheck + 1;
  1215.     }
  1216.     NBScrollForRange(115, 132);
  1217.     
  1218.     DooWopDispatch(8, 4);
  1219.     SheBopFinale();
  1220.     
  1221.     MenusOnOff(1);    /* turn on menus */
  1222.     NBScrollForRange(118, 130);
  1223. EnableActions();
  1224. HoldMouseDowns(0);
  1225. }
  1226.  
  1227. /*-----------------------*/
  1228.  
  1229. Àá